package com.own.core.html.component;


import java.util.Iterator;

import org.apache.wicket.markup.repeater.data.IDataProvider;
import org.apache.wicket.model.IModel;

import com.own.core.html.component.DetachableDaoModel;
import com.own.core.object.Dao;
import com.own.core.object.admin.User;
import com.own.core.operation.DbOperation;


/**
 * Implementation of IDataProvider that retrieves contacts from the contact database.
 * 
 * @author igor
 * 
 */
public class OwnDataProvider implements IDataProvider
{

	@Override
	public void detach() {
		 
		
	}

	@Override
	public Iterator iterator(int first, int count) {
		return DbOperation.getME().listAll(User.class).iterator();
			}

	@Override
	public int size() {
	 
		return 20;
	}

	@Override
	public IModel model(Object object) {
		 
		return new DetachableDaoModel((Dao) object) ;
	}
 
   

}